package cn.csc.module.member.api.userrole;

import cn.csc.framework.common.pojo.CommonResult;
import cn.csc.module.member.service.userrole.MemberUserRoleService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigInteger;

/**
 * 会员和角色关联表的 API 实现类
 * @author liuchuang
 * @version 1.0
 * @modify
 * @since 2024/11/28 9:04
 */
@RestController // 提供 RESTful API 接口，给 Feign 调用
@Validated
public class MemberUserRoleApiImpl implements MemberUserRoleApi{

    @Resource
    private MemberUserRoleService memberUserRoleService;

    @Override
    public CommonResult<Boolean> relate(BigInteger userId, String roleCode) {
        memberUserRoleService.relate(userId, roleCode);
        return CommonResult.success(true);
    }


}
